<?php  
class CustomEventHandler {  
    static function handleMissingTranslation($event) {  
		$filepath = $_SERVER['DOCUMENT_ROOT']."protected/messages/missing/".$event->language."/";
		$filename = $event->category.".php";
		if (!file_exists($filepath)) {
			mkdir($filepath, 0755, true);
		}
		$data = "'".$event->message."' => '". $event->message ."'"."\r\n";
		file_put_contents($filepath.$filename, $data, FILE_APPEND | LOCK_EX);
    }  
}